// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: "2025-07-15",
  devtools: { enabled: true },
  ssr: false, // 客户端渲染，适合后台管理系统

  // 样式配置
  css: ["element-plus/dist/index.css"],

  // 模块配置
  modules: ["@element-plus/nuxt"],

  // Element Plus配置
  elementPlus: {
    importStyle: "css",
  },

  // Nitro配置
  nitro: {
    experimental: {
      wasm: true,
    },
    devProxy: {
      "/api": {
        target: "http://localhost:8089",
        changeOrigin: true,
        secure: false,
      },
    },
  },

  // 开发服务器配置
  devServer: {
    port: 3000,
  },

  // TypeScript配置
  typescript: {
    strict: false,
    typeCheck: false,
  },

  // Vite配置
  vite: {
    css: {
      preprocessorOptions: {
        less: {
          javascriptEnabled: true,
        },
      },
    },
  },
});
